package cn.udrm.water.base.v1.waterdelivery.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedAttributeNode;
import javax.persistence.NamedEntityGraph;
import javax.persistence.Table;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import org.hibernate.annotations.GenericGenerator;

/**
 * 倒虹吸
 * @author liukang
 * @date 2018年11月7日
 */
@Setter
@Getter
@Entity(name="InvertedSiphon")
@Table(name="T_INVERTED_SIPHON")
@NamedEntityGraph(name="InvertedSiphon.all",
				attributeNodes={
					@NamedAttributeNode("canalSystem")
})
@NoArgsConstructor
public class InvertedSiphon {
	
	@Id
	@GenericGenerator(name="idGenerator", strategy="uuid")
	@GeneratedValue(generator="idGenerator")
	@Column(name="ID")
	private String id;
	/*
	 * 系统编码
	 */
	@Column(name="ENTITY_CODE")
	private String entityCode;
	@Column(name="CREATE_DATE")
	private Date createDate;
	@Column(name="PERSON_GUID")
	private String personGuid;
	@Column(name="PERSON_NAME")
	private String personName;
	
	/*
	 * 桩号
	 */
	@Column(name="MILEAGE")
	private String mileage;
	
	@Column(name="NAME")
	private String name;
	@Column(name="INFO_REMARKS", length=2048)
	private String infoRemarks;
	/*
	 * 绑定倒虹吸和渠道关系
	 */
	@ManyToOne(optional=true)
	@JoinColumn(name="CANAL_SYSTEM_GUID")
	private CanalSystem canalSystem;
	
	public InvertedSiphon(String id) {
		this.id = id;
	}
}
